<!doctype html>
<html style="" class=" js flexbox flexboxlegacy canvas canvastext webgl no-touch geolocation postmessage websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="referrer" content="never">
		<meta http-equiv="Content-Language" content="zh-cn">
		<meta name="apple-mobile-web-app-capable" content="no">
		<meta name="apple-touch-fullscreen" content="yes">
		<meta name="format-detection" content="telephone=no,email=no">
		<meta name="apple-mobile-web-app-status-bar-style" content="white">
		<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
		<meta http-equiv="Expires" content="0">
		<meta http-equiv="Pragma" content="no-cache">
		<meta http-equiv="Cache-control" content="no-cache">
		<meta http-equiv="Cache" content="no-cache">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>衔电充电宝</title>
		<link rel="stylesheet" href="css/index.css" />
		<link rel="stylesheet" href="css/alert.css" />
	</head>
	<body>

	</body>
	<script src="js/jquery.min.js"></script>
	<script>
		// var ua = navigator.userAgent.toLowerCase();
		// console.log("ua:{}", ua)
		// if (ua.match(/MicroMessenger/i) == "micromessenger") {
		// 	alert("请使用微信扫码")
		// } else {
		// 	window.location.href="alipays://platformapi/startapp?appId=2021002122629875";
		// }
		function getQueryVariable(variable){
		       var query = window.location.search.substring(1);
		       var vars = query.split("&");
		       for (var i=0;i<vars.length;i++) {
		               var pair = vars[i].split("=");
		               if(pair[0] == variable){return pair[1];}
		       }
		       return(false);
		}
		var browser = {
		    versions: function () {
		        var u = navigator.userAgent, app = navigator.appVersion;
		        return {         //移动终端浏览器版本信息
		            trident: u.indexOf('Trident') > -1, //IE内核
		            presto: u.indexOf('Presto') > -1, //opera内核
		            webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
		            gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
		            mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
		            ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
		            android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
		            iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
		            iPad: u.indexOf('iPad') > -1, //是否iPad
		            webApp: u.indexOf('Safari') == -1 //是否web应该程序，没有头部与底部
		        };
		    }(),
		    language: (navigator.browserLanguage || navigator.language).toLowerCase()
		}
		console.log(browser.versions)
		if (browser.versions.mobile) {//判断是否是移动设备打开。browser代码在下面
		        var ua = navigator.userAgent.toLowerCase();//获取判断用的对象
				if (ua.match(/Alipay/i)=="alipay") {
					var baseSn =  getQueryVariable("baseSn");
					console.log("baseSn:{}",baseSn)
					window.location.href =
				       `https://ds.alipay.com/?scheme=` +
				        encodeURIComponent(
				          `alipays://platformapi/startapp?appId=2021002122629875&page=pages/confirm/confirm?baseSn=`+baseSn
				        )					   
				}else{
					alert("请使用支付宝打开")
					// if (ua.match(/MicroMessenger/i) == "micromessenger") {
					//        alert("微信")
					// }
					// if (ua.match(/QQ/i) == "qq") {
					//       alert("QQ")
					// }
					// if (browser.versions.ios) {
					//         alert("ios")
					// } 
					// if(browser.versions.android){
					//        alert("安卓")
					// }
				}
		 
		} else {
			alert("请使用支付宝打开")
		}
	</script>
</html>
